﻿using System;
using ProdControls.NativePatterns.MessageConstants;
using ProdControls.Utility;

namespace ProdControls
{
    internal static class ProdRadioButtonNative
    {
        internal static bool GetCheckStateNative(IntPtr windowHandle)
        {
            int retVal =
                (int) NativeMethods.SendMessage(windowHandle, (int) ButtonMessages.BM_GETCHECK, 0, 0);

            return retVal == (int) ButtonStates.BST_CHECKED;
        }

        internal static void SetCheckStateNative(IntPtr windowHandle)
        {
            //ProdUIAutomation.NativePrologue(windowHandle);
            NativeMethods.SendMessage(windowHandle, (int) ButtonMessages.BM_SETCHECK,
                                      (int) ButtonStates.BST_CHECKED, 0);
        }
    }
}